    //
//  ContentViewController.m
//  NumLot
//
//  Created by luotao on 12-8-12.
//  Copyright 2012 __MyCompanyName__. All rights reserved.
//

#import "ContentViewController.h"
#import "TouchImage.h"
#import "Cons.h"
#import "LotViewController.h"
#import "ButtomViewController.h"
#import "TouchView.h"
@implementation ContentViewController

/*
 // The designated initializer.  Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
        // Custom initialization
    }
    return self;
}
*/

-(id) init{
	if(!(self=[super init])){
		return nil;
	}
	viewMoveListener = [[NSMutableArray alloc] init];
	currentViewIndex=1;
	moveAbleView = [[NSMutableArray alloc] init];
	currentDot=0;
	dotViews = [[NSMutableArray alloc] init];
	return self;
}

-(void) addMoveListener:(id<ViewOutScreenListener>) viewOutScreentListener{
	[viewMoveListener addObject:viewOutScreentListener];
}

// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView {
	
	[super loadView];
	
	[self loadMainButton];
	
	[self loadLeftButtomMenu];
	
	[self loadMiddleButtomMenu];
}


-(void)loadMainButton{
	selectView=[[UIView alloc] init];
	
	CGRect zero = CGRectMake(0,OFFSET_HEIGHT, SCREEN_WIDTH, SCREEN_HEIGHT);
	
	selectView.frame=zero;
	
	self.view.frame=zero;
	
	[self.view addSubview:selectView];
	
	UIImage *image = [UIImage imageNamed:@"icon_home"];
	
	
	for(int i=0;i<6;i++){
		int j=i%3;
		int k=i/3;
		
		
		CGImageRef imageRef=CGImageCreateWithImageInRect([image CGImage], CGRectMake(i*73*OS_TYPE, 0, 73*OS_TYPE, 94*OS_TYPE));
		
		
		UIImage *eleImg=[UIImage imageWithCGImage:imageRef];
		
		UIImageView *imageView = [[UIImageView alloc] initWithImage:eleImg];
		
		imageView.frame = CGRectMake(20+j*103, 120*k, 73, 94);	
		
		[selectView addSubview:imageView];		
		UITapGestureRecognizer *singleTouch=[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTap:)];	
		NSString *str = [NSString stringWithFormat:@"%d%d",TAG_MAIN_BUT,i+1];		
		imageView.tag = [str intValue];
		imageView.userInteractionEnabled=YES;		
		[imageView addGestureRecognizer:singleTouch];
		[singleTouch release];
		
		[imageView release];
	}
    
	lotViewController = [[LotViewController alloc] init];
	[self.view addSubview:lotViewController.view];
	lotViewController.view.frame=RECT_RIGHT;
    //lotViewController.view.frame=CGRectMake(300, 0, 320, 480);
	if (LOG_DEBUG) {
		NSLog(@"lotViewController view x %f",lotViewController.view.frame.origin.x);
        NSLog(@"self.view y %f",self.view.frame.origin.y);
	}
	
	
	
	[moveAbleView addObject:selectView];
	[moveAbleView addObject:lotViewController.view];
	
	//coverImageView = [[TouchImage alloc] init];
//	coverImageView.userInteractionEnabled=YES;
//	coverImageView.frame=CGRectMake(0, 0, 320, 300);
//	coverImageView.eventCallback=self;
//	coverImageView.touchEnd=@selector(hideAllView:srcEvent:);
//	coverImageView.backgroundColor=[UIColor blueColor];	
//	[self.view.superview.superview addSubview:coverImageView];
//	NSLog(@"load cover iamge");
}

-(void)loadLeftButtomMenu{
	leftButtomImageView = [[TouchImage alloc]initWithImage:[UIImage imageNamed:@"fn_bg.png"]];
	leftButtomImageView.frame=CGRectMake(0, 260, 320, 0);
	//leftButtomImageView.frame=CGRectMake(0, 260, 320, 140);
	leftButtomImageView.alpha=0.0;
	leftButtomImageView.userInteractionEnabled=YES;
	UIImage *image = [UIImage imageNamed:@"fn_a_icon"];
		
	for(int i=0;i<8;i++){
		int j=i%4;
		int k=i/4;
		
		CGImageRef imageRef1=CGImageCreateWithImageInRect([image CGImage], CGRectMake(i*50*OS_TYPE, 0, 50*OS_TYPE, 45*OS_TYPE));	
		UIImage *eleImg=[UIImage imageWithCGImage:imageRef1];	
		TouchImage *imageViewTemp = [[TouchImage alloc] initWithImage:eleImg];	
		imageViewTemp.frame = CGRectMake(20+j*75, 10+k*60, 50, 45);	
		imageViewTemp.tag=150000+i+1;
		
		
		[leftButtomImageView addSubview:imageViewTemp];
		[leftButtomImageView bringSubviewToFront:imageViewTemp];
		[leftButtomImageViews addObject:imageViewTemp];
		
		[imageViewTemp release];
	}
	
	lineH = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"fn_line_h"]];
	lineH.frame=CGRectMake(0, 61, 320, 1);	
	
	[leftButtomImageView addSubview:lineH];
	
	lineV1 = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"fn_line_v"]];
	lineV1.frame = CGRectMake(80, 10, 1, 100);
		
	lineV2 = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"fn_line_v"]];
	lineV2.frame = CGRectMake(160, 10, 1, 100);	
		
	lineV3 = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"fn_line_v"]];
	lineV3.frame = CGRectMake(230, 10, 1, 100);	
		
	
	[leftButtomImageView addSubview:lineV1];
	
	
	[leftButtomImageView addSubview:lineV2];
	
	
	[leftButtomImageView addSubview:lineV3];
	
	//[menuView addSubview:imageView];
	[self.view addSubview:leftButtomImageView];
	
}


-(void)doTapBegin:(NSSet *)touches srcEvent:(TouchImage *)src{
	
	CGPoint currentPoint = [[touches anyObject] locationInView:src];
	if(LOG_DEBUG){
		NSLog(@"x : %f",currentPoint.x);
	}
}


-(void)doTapMoved:(NSSet *)touches srcEvent:(TouchImage *)src{
	
	CGPoint currentPoint = [[touches anyObject] locationInView:src];
	if(LOG_DEBUG){
		NSLog(@"toucview doTapMoved");
		NSLog(@"startX : %f  x : %f",src.startX,currentPoint.x);
	}
	float xx = currentPoint.x-src.startX;
	CGRect currentRect = lotMoveView1.frame;
	if(LOG_DEBUG){
		NSLog(@"currentRect x : %f",currentRect.origin.x);
		
	}
	CGRect currentRect1 = lotMoveView1.frame;
	float offset1 = currentRect1.origin.x+xx;
	if(offset1>60){
		offset1=60;
	}
	
	
	
	lotMoveView1.frame=CGRectMake(offset1, currentRect1.origin.y, currentRect1.size.width, currentRect1.size.height);
	
	CGRect currentRect2 = lotMoveView2.frame;
	lotMoveView2.frame=CGRectMake(currentRect2.origin.x+xx, currentRect2.origin.y, currentRect2.size.width, currentRect2.size.height);
	
	CGRect currentRect3 = lotMoveView3.frame;
	lotMoveView3.frame=CGRectMake(currentRect3.origin.x+xx, currentRect3.origin.y, currentRect3.size.width, currentRect3.size.height);
	
	CGRect currentRect4 = lotMoveView4.frame;
	
	int offset4 = (int)(currentRect4.origin.x+xx);
	if(offset4<-60){
		offset4=-60;
	}	
	lotMoveView4.frame=CGRectMake(offset4, currentRect4.origin.y, currentRect4.size.width, currentRect4.size.height);
	
	src.currentX=currentPoint.x;

	
}

-(void)doTapEnd:(NSSet *)touches srcEvent:(TouchImage *)src{
	NSLog(@"startX : %f,current %f",src.startX,src.currentX);
	src.backgroundColor=[UIColor clearColor];
	if(src.startX>src.currentX){
		
		
		
		float currentX1=lotMoveView1.frame.origin.x;
		float currentX2=lotMoveView2.frame.origin.x;
		float currentX3=lotMoveView3.frame.origin.x;
		float currentX4=lotMoveView4.frame.origin.x;
		
		currentX1=currentX1+1280;
		currentX2=currentX2+1280;
		currentX3=currentX3+1280;
		currentX4=currentX4+1280;
		
		int offset1 = (currentX1/320);
		int offset2 = (currentX2/320);
		int offset3 = (currentX3/320);
		int offset4 = (currentX4/320);
	
		int offset11=(offset1-4)*320;
		int offset22=(offset2-4)*320;
		int offset33=(offset3-4)*320;
		int offset44=(offset4-4)*320;
		
		[UIView beginAnimations:@"doTapBegin" context:nil];
		[UIView setAnimationDuration:0.2];
		lotMoveView1.frame=CGRectMake(offset11<-960?-960:offset11,lotMoveView1.frame.origin.y,lotMoveView1.frame.size.width,lotMoveView1.frame.size.height);
		
		
		
		lotMoveView2.frame=CGRectMake(offset22<-640?-640:offset22,lotMoveView2.frame.origin.y,lotMoveView2.frame.size.width,lotMoveView2.frame.size.height);
		
		
		
		lotMoveView3.frame=CGRectMake(offset33<-320?-320:offset33,lotMoveView3.frame.origin.y,lotMoveView3.frame.size.width,lotMoveView3.frame.size.height);
		
		lotMoveView4.frame=CGRectMake(offset44<0?0:offset44,lotMoveView4.frame.origin.y,lotMoveView4.frame.size.width,lotMoveView4.frame.size.height);
		
		[UIView commitAnimations];
		
		if(offset44<0){
			currentDot=3;
		}else {
			
			[currentDotView removeFromSuperview];
			currentDot++;
			UIImageView *tempView = [dotViews objectAtIndex:currentDot];
			
			
			CGRect rect=tempView.frame;			
			
			currentDotView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"dot_red.png"]];
			
			currentDotView.frame=rect;
			
			[middleButtomImageView addSubview:currentDotView];		}

		
		
	}else if(src.startX<src.currentX){
			
		float currentX1=lotMoveView1.frame.origin.x;
		float currentX2=lotMoveView2.frame.origin.x;
		float currentX3=lotMoveView3.frame.origin.x;
		float currentX4=lotMoveView4.frame.origin.x;
		
		currentX1=currentX1+1280;
		currentX2=currentX2+1280;
		currentX3=currentX3+1280;
		currentX4=currentX4+1280;
		
		int offset1 = (currentX1/320);
		int offset2 = (currentX2/320);
		int offset3 = (currentX3/320);
		int offset4 = (currentX4/320);
	
		int offset11=(offset1-3)*320;
		int offset22=(offset2-3)*320;
		int offset33=(offset3-3)*320;
		int offset44=(offset4-3)*320;
		
	
		[UIView beginAnimations:@"doTapBegin" context:nil];
		[UIView setAnimationDuration:0.2];
		
		lotMoveView1.frame=CGRectMake(offset11>0?0:offset11,lotMoveView1.frame.origin.y,lotMoveView1.frame.size.width,lotMoveView1.frame.size.height);
		
		
		
		lotMoveView2.frame=CGRectMake(offset22>320?320:offset22,lotMoveView2.frame.origin.y,lotMoveView2.frame.size.width,lotMoveView2.frame.size.height);
		
		
		
		lotMoveView3.frame=CGRectMake(offset33>640?640:offset33,lotMoveView3.frame.origin.y,lotMoveView3.frame.size.width,lotMoveView3.frame.size.height);
		
		lotMoveView4.frame=CGRectMake(offset44>960?960:offset44,lotMoveView4.frame.origin.y,lotMoveView4.frame.size.width,lotMoveView4.frame.size.height);
		
		[UIView commitAnimations];
		
		if(offset44>960){
			currentDot=0;
		}else {
			
			[currentDotView removeFromSuperview];
			currentDot--;
			UIImageView *tempView = [dotViews objectAtIndex:currentDot];
			
			CGRect rect=tempView.frame;			
			
			currentDotView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"dot_red.png"]];
			
			currentDotView.frame=rect;
			
			[middleButtomImageView addSubview:currentDotView];
			
			
		}
		
		
	}
	
	
}

-(void)doTapBegin1:(NSSet *)touches srcEvent:(TouchImage *)src{
	//src.backgroundColor=[UIColor blueColor];
}


-(void)loadMiddleButtomMenu{
	
	middleButtomImageView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"fn_bg.png"]];
	middleButtomImageView.frame=CGRectMake(0, 260, 320, 0);
	middleButtomImageView.alpha=0.0;
	middleButtomImageView.userInteractionEnabled=YES;
	[self.view addSubview:middleButtomImageView];
	
	lotMoveView1 = [[TouchView alloc] init];
	lotMoveView1.userInteractionEnabled=YES;
	lotMoveView1.backgroundColor=[UIColor clearColor];
	lotMoveView1.frame=CGRectMake(0, 0, 320, 140);
	lotMoveView1.tag=TAG_MIDDLE_BUTTOM_VIEW1;
	lotMoveView1.eventCallback=self;
	lotMoveView1.touchEnd=@selector(doTapEnd:srcEvent:);
	lotMoveView1.touchMoved=@selector(doTapMoved:srcEvent:);
	
	
	lotMoveView2 = [[TouchView alloc] init];
	lotMoveView2.userInteractionEnabled=YES;
	lotMoveView2.backgroundColor=[UIColor clearColor];
	lotMoveView2.frame=CGRectMake(320, 0, 320, 140);
	lotMoveView2.tag=TAG_MIDDLE_BUTTOM_VIEW2;
	lotMoveView2.eventCallback=self;
	lotMoveView2.touchEnd=@selector(doTapEnd:srcEvent:);
	lotMoveView2.touchMoved=@selector(doTapMoved:srcEvent:);

	
	
	lotMoveView3 = [[TouchView alloc] init];
	lotMoveView3.userInteractionEnabled=YES;
	lotMoveView3.backgroundColor=[UIColor clearColor];
	lotMoveView3.frame=CGRectMake(640, 0, 320, 140);
	lotMoveView3.tag=TAG_MIDDLE_BUTTOM_VIEW3;
	lotMoveView3.eventCallback=self;
	lotMoveView3.touchEnd=@selector(doTapEnd:srcEvent:);
	lotMoveView3.touchMoved=@selector(doTapMoved:srcEvent:);

	
	
	lotMoveView4 = [[TouchView alloc] init];
	lotMoveView4.userInteractionEnabled=YES;
	lotMoveView4.backgroundColor=[UIColor clearColor];
	lotMoveView4.frame=CGRectMake(960, 0, 320, 140);
	lotMoveView4.tag=TAG_MIDDLE_BUTTOM_VIEW4;
	lotMoveView4.eventCallback=self;
	lotMoveView4.touchEnd=@selector(doTapEnd:srcEvent:);
	lotMoveView4.touchMoved=@selector(doTapMoved:srcEvent:);

	
	[middleButtomImageView addSubview:lotMoveView1];
	[middleButtomImageView addSubview:lotMoveView2];
	[middleButtomImageView addSubview:lotMoveView3];
	[middleButtomImageView addSubview:lotMoveView4];
	
	
	
	UIImage *image = [UIImage imageNamed:@"fn_b_icon.png"];
	for(int i=0;i<16;i++){
		
	//	middleSwipView1=[[UIView alloc]init];
		int k=i/4;
		int j=i%4;
		CGImageRef imageRef1=CGImageCreateWithImageInRect([image CGImage], CGRectMake(i*62*OS_TYPE, 0, 62*OS_TYPE, 70*OS_TYPE));	
		UIImage *eleImg=[UIImage imageWithCGImage:imageRef1];	
		TouchImage *imageViewTemp = [[TouchImage alloc] initWithImage:eleImg];
		imageViewTemp.frame = CGRectMake(20+j*75, 25, 62, 70);
		imageViewTemp.eventCallback=self;
		imageViewTemp.touchBegin=@selector(doTapBegin1:srcEvent:);
		imageViewTemp.touchEnd=@selector(doTapEnd:srcEvent:);
		imageViewTemp.touchMoved=@selector(doTapMoved:srcEvent:);
		if(k==0){
			[lotMoveView1 addSubview:imageViewTemp];
			if(j>0){
				UIImageView *lineView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"fn_line_v"]];
				lineView.frame = CGRectMake(15+j*75, 10, 1, 100);
				[lotMoveView1 addSubview:lineView];
				[lineView release];

			}
		}else if (k==1) {
			[lotMoveView2 addSubview:imageViewTemp];
			if(j>0){
				UIImageView *lineView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"fn_line_v"]];
				lineView.frame = CGRectMake(15+j*75, 10, 1, 100);
				[lotMoveView2 addSubview:lineView];
				[lineView release];
				
			}
		}else if (k==2) {
			[lotMoveView3 addSubview:imageViewTemp];
			if(j>0){
				UIImageView *lineView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"fn_line_v"]];
				lineView.frame = CGRectMake(15+j*75, 10, 1, 100);
				[lotMoveView3 addSubview:lineView];
				[lineView release];
				
			}
		}else if (k==3) {
			[lotMoveView4 addSubview:imageViewTemp];
			if(j>0){
				UIImageView *lineView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"fn_line_v"]];
				lineView.frame = CGRectMake(15+j*75, 10, 1, 100);
				[lotMoveView4 addSubview:lineView];
				[lineView release];
				
			}
		}
				
		
		[middleButtomImageViews addObject:imageViewTemp];
		
		
		
		
		
		[imageViewTemp release];
	}
	
	for(int i=0;i<4;i++){
		UIImageView *dotImageView;
		
		dotImageView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"dot_gray.png"]];	
		[dotViews addObject:dotImageView];
		dotImageView.frame=CGRectMake(i*15+135, 110, 7, 7);
		[middleButtomImageView addSubview:dotImageView];
		
		if(i==0){
			currentDotView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"dot_red.png"]];
			currentDotView.frame=CGRectMake(i*15+135, 110, 7, 7);
			[middleButtomImageView addSubview:currentDotView];
		}
		
		
	}
	
}


-(void)handleSingleTap:(UITapGestureRecognizer *)ids{	
	[self moveView:2];
}

-(void)moveView:(int) index{
	
	int offset = (index-currentViewIndex)*(-1);
	
	[UIView beginAnimations:@"moveView" context:nil];		
	[UIView setAnimationDuration:0.3];
	[UIView setAnimationDelegate:self];
	[UIView setAnimationDidStopSelector:@selector(fireMovedEvent:)];
	for(int i=0;i<[moveAbleView count];i++){
		UIView *views = (UIView *)[moveAbleView objectAtIndex:i];
		float currentX = views.frame.origin.x;
        float currentY = views.frame.origin.y;
		float move_x = currentX+offset*SCREEN_WIDTH;
		CGRect rect12 = CGRectMake(move_x, currentY, SCREEN_WIDTH, SCREEN_HEIGHT); 
		views.frame=rect12;
	}
	[UIView commitAnimations];
	currentViewIndex=index;
}


-(void) fireMovedEvent:(id) ids{
	for (id<ViewOutScreenListener> listener in viewMoveListener) {
		[listener doOutScreen:self];
	}
}


-(NSInteger) getCurrentViewIndex{
	return currentViewIndex;
}



-(void)doEvent:(UIViewController *)controller eventType:(int) type{
	if (LOG_DEBUG) {
		NSLog(@"tag : %d",type);
	}	
	if(type==TAG_BTM_MENU1){
		ButtomViewController *buttomController = (ButtomViewController *)controller;
		TouchImage *toucImage = (TouchImage *)buttomController.leftButtomImageView;
		toucImage.userInteractionEnabled=NO;
		//		NSLog(@"showLeftButtom : %d",showLeftButtom);
		if(!showLeftButtom){
			[self showLeftButtomMenu];
			if(showMiddleButtom){
				[self hideMiddleButtomMenu];
				showMiddleButtom=NO;
			}
			showLeftButtom=YES;
			[self showCoverView];
		}else {
			[self hideCoverView];
			[self hideLeftButtomMenu];		
			showLeftButtom=NO;
		}
		toucImage.userInteractionEnabled=YES;
	}else if(type==TAG_BTM_MENU2){
		if (LOG_DEBUG) {
			NSLog(@"show middle");
		}
		if(!showMiddleButtom){
			
			[self showMiddleButtomMenu];
			if(showLeftButtom){
				[self hideLeftButtomMenu];
				showLeftButtom=NO;
			}
			showMiddleButtom=YES;
			[self showCoverView];
			
		}else {
			[self hideMiddleButtomMenu];
			showMiddleButtom=NO;
			[self hideCoverView];
		}
	}
	
}

-(void)showCoverView{
//	NSLog(@"show cover123");
	//NSLog(@"retain count %d",[coverImageView retainCount]);
//	NSLog(@"coverImageView : %@",coverImageView);
	if(coverImageView!=nil){
		NSLog(@"release1 coverImageView");
		
		[coverImageView release];
		NSLog(@"release2 coverImageView");
		[coverImageView removeFromSuperview];
		
		coverImageView=nil;
		NSLog(@"retain count after1 %d",[coverImageView retainCount]);
	}
	coverImageView = [[TouchImage alloc] init];
	coverImageView.userInteractionEnabled=YES;
	coverImageView.frame=CGRectMake(0, 0, 320, 300);
	coverImageView.eventCallback=self;
	coverImageView.touchEnd=@selector(hideAllView:srcEvent:);
//	coverImageView.backgroundColor=[UIColor blueColor];	
	NSLog(@"retain count after2 %d",[coverImageView retainCount]);
	[self.view.superview.superview addSubview:coverImageView];
	NSLog(@"retain count after3 %d",[coverImageView retainCount]);
}

-(void)hideCoverView{
//	NSLog(@"show cover");
	if(coverImageView!=nil){
		NSLog(@"release in hideCoverView retain1 count %d",[coverImageView retainCount]);
		[coverImageView removeFromSuperview];
		NSLog(@"release in hideCoverView retain2 count %d",[coverImageView retainCount]);
		[coverImageView release];
		NSLog(@"release in hideCoverView retain3 count %d",[coverImageView retainCount]);
		coverImageView=nil;
		NSLog(@"release in hideCoverView retain4 count %d",[coverImageView retainCount]);
	}
}

-(void)hideAllView:(NSSet *)touches srcEvent:(TouchImage *)src{
	if(showLeftButtom){
		[self hideLeftButtomMenu];
		showLeftButtom=NO;
	}
	if (showMiddleButtom) {
		[self hideMiddleButtomMenu];
		showMiddleButtom=NO;
		
	}
	[coverImageView removeFromSuperview];
	
	
}


-(void)showMiddleButtomMenu{
	middleButtomImageView.frame=CGRectMake(0, 400, 320, 140);
	middleButtomImageView.alpha=1.0;
	[UIView beginAnimations:@"showMiddleButtomMenu" context:nil];
	[UIView setAnimationDuration:0.2];
	middleButtomImageView.frame=CGRectMake(0, 260, 320, 140);
	[UIView commitAnimations];
}


-(void)hideMiddleButtomMenu{
	middleButtomImageView.frame=CGRectMake(0, 260, 320, 140);
	[UIView beginAnimations:@"showMiddleButtomMenu" context:nil];
	[UIView setAnimationDuration:0.2];
	middleButtomImageView.frame=CGRectMake(0, 400, 320, 140);
	[UIView commitAnimations];
	
}

-(void)showLeftButtomMenu{
	//[self.view addSubview:leftButtomImageView];
	leftButtomImageView.frame=CGRectMake(0, 400, 320, 140);
	
	[UIView beginAnimations:@"showLeftButtomMenu" context:nil];
	[UIView setAnimationDuration:0.2];
	
	leftButtomImageView.alpha=1.0;
	leftButtomImageView.frame=CGRectMake(0, 260, 320, 140);	
	
	[UIView commitAnimations];
	
}

-(void)hideLeftButtomMenu{
	if(LOG_DEBUG){
		NSLog(@"hidden ");
	}
	leftButtomImageView.frame=CGRectMake(0, 260, 320, 140);
	[UIView beginAnimations:@"hideLeftButtomMenu" context:nil];		
	[UIView setAnimationDuration:0.2];	
	leftButtomImageView.frame=CGRectMake(0, 400, 320, 140);
	[UIView commitAnimations];
}





/*
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    [super viewDidLoad];
}
*/

/*
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
*/

- (void)didReceiveMemoryWarning {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

- (void)viewDidUnload {
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}


- (void)dealloc {
	if (LOG_DEBUG) {
		NSLog(@"realse contentViewController");
	}
	[leftButtomImageView release];
	
	[leftButtomImageViews release];
	[middleButtomImageViews release];

	[lineV1 release];
	[lineV2 release];
	[lineV3 release];
	
	[lineH release];
	
	[selectView release];
	[moveAbleView release];
	[viewMoveListener release];
	[lotViewController release];
    [super dealloc];
}


@end
